<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		Broadcastweb.eu - Paules												/
/	Site:			http://www.broadcastweb.eu												/
/	Email:			support@broadcastweb.eu													/
/	Copyright:		2011 - 2012 (c) Broadcastweb.eu											/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0003																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla Security
defined('_JEXEC') or die;
JHTML::_('behavior.mootools');
jimport('joomla.application.component.helper');
if(JComponentHelper::isEnabled('com_joosam', true)):
	$jsmHistory_color_lbl = $params->get('history_lblColor', '#000000');
	$jsmHistory_color_data = $params->get('history_dataColor', '#000000');
	$jsmHistory_background0 = $params->get('history_bgRow0', '#FFFFFF');
	$jsmHistory_background0hv = $params->get('history_bgRow0_hv', '#FFFFFF');
	$jsmHistory_background1 = $params->get('history_bgRow1', '#FFFFFF');
	$jsmHistory_background1hv = $params->get('history_bgRow1_hv', '#FFFFFF');
	$jsmHistory_maxSongs = $params->get('history_maxSongs', 5);

	if($jsmHistory_background0 == '#FFFFFF'){ $jsmHistory_background0 = 'none'; }
	if($jsmHistory_background0hv == '#FFFFFF'){ $jsmHistory_background0hv = 'none'; }
	if($jsmHistory_background1 == '#FFFFFF'){ $jsmHistory_background1 = 'none'; }
	if($jsmHistory_background1hv == '#FFFFFF'){ $jsmHistory_background1hv = 'none'; }
	?>
	<style type="text/css">
		.jsm_mod_history{
			padding-left:2px !important;
		}
		.jsm_mod_history .jsm_song_bg0{
			width:98%;
			background: <?php echo $jsmHistory_background0; ?>;
		}
		.jsm_mod_history .jsm_song_bg0:hover{
			background: <?php echo $jsmHistory_background0hv; ?>;
		}
		.jsm_mod_history .jsm_song_bg1{
			width:98%;
			background: <?php echo $jsmHistory_background1; ?>;
		}
		.jsm_mod_history .jsm_song_bg1:hover{
			background: <?php echo $jsmHistory_background1hv; ?>;
		}
		.jsm_mod_history .jsm_hisArtistLabel{
			color: <?php echo $jsmHistory_color_lbl; ?>;
			text-align:left;
			width:50px;
		}
		.jsm_mod_history .jsm_hisArtistData{
			color: <?php echo $jsmHistory_color_data; ?>;
			text-align:left;
		}
	</style>
	<div id="jsm_history" class="jsm_mod_history"></div><?php
	$joosam_plugin = JPluginHelper::isEnabled('system', 'joosam');
	if($joosam_plugin):	?>
		<script>
			var timer = 5000;
			var artist_name = "<?php echo JText::_('MOD_JOOSAM_HISTORY_ARTIST'); ?>";
			var title_name = "<?php echo JText::_('MOD_JOOSAM_HISTORY_TITLE'); ?>";
			var jsmHistory_maxSongs = <?php echo $jsmHistory_maxSongs; ?>;
			setTimeout('joosam.ajax_history("jsm_history", '+timer+', "'+artist_name+':", "'+title_name+':", jsmHistory_maxSongs)', 3000);
		</script> <?php
	else: ?>
		<div id="jsm_history">
			<div style="background:white; color:red; font-weight:bold; border-radius:10px; margin:1px; text-align:center; padding:0;">
				<?php echo JText::_('MOD_JOOSAM_HISTORY_NOPLUGIN'); ?>
			</div>
		</div><?php
	endif;
else: ?>
	<div id="jsm_history">
		<div style="background:white; color:red; font-weight:bold; border-radius:10px; margin:1px; text-align:center; padding:0;">
			<?php echo JText::_('MOD_JOOSAM_HISTORY_NOCOMPONENT'); ?>
		</div>
	</div><?php
endif;
?>